//
//  PersonModel.m
//  regularExpression
//
//  Created by leiyan on 2017/4/19.
//  Copyright © 2017年 leiyan. All rights reserved.
//

#import "PersonModel.h"

@implementation PersonModel
- (instancetype)initWithName:(NSString *)name age:(NSUInteger)age sex:(PersonSex)sex {
    if (self = [super init]) {
        _name = name;
        _age = age;
        _sex = sex;
    }
    return self;
}

+ (instancetype)personWithName:(NSString *)name age:(NSUInteger)age sex:(PersonSex)sex {
    return [[self alloc] initWithName:name age:age sex:sex];
}

- (NSString *)description {
    return [NSString stringWithFormat:@"[name = %@, age = %ld, sex = %ld]", self.name, self.age, self.sex];
}
@end
